<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<c:url value="/resources/js/jquery-3.4.1.min.js" />"></script>
<link href="<c:url value="/resources/bootstrap/bootstrap-4.4.1-dist/css/bootstrap.min.css" />" rel="stylesheet">
<link href="<c:url value="/resources/bootstrap/bootstrap-4.4.1-dist/css/bootstrap-datetimepicker.min.css" />" rel="stylesheet">
<script type="text/javascript" src="<c:url value="/resources/bootstrap/bootstrap-4.4.1-dist/js/bootstrap.min.js" />"></script>
<script type="text/javascript" src="<c:url value="/resources/bootstrap/bootstrap-4.4.1-dist/js/bootstrap-datetimepicker.js" />"></script>
<script type="text/javascript" src="<c:url value="/resources/bootstrap/bootstrap-4.4.1-dist/js/bootstrap-datetimepicker.zh-CN.js" />"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"  >
<title>注册</title>
</head>

<body>
<style>
    .wrapper{
        width:30%;
        margin:0 auto;
        margin-top: 50px;
    }
    .alert{
        color:red;
    }
</style>
    <c:choose>
        <c:when test="${exceptionInfo ==''}">
	        <div class="jumbotron">
			  <h1><span>恭喜您注册成功~~!&emsp;</span></h1>
			  <p><a class="btn btn-primary btn-lg" href="<c:url value='/' />" role="button">Go To Login</a></p>
			</div>
        </c:when>
        <c:otherwise>
        <div class="wrapper">
            <div>
		        <form action="<c:url value="/registered/handlerRegistered.do" />" method="post">
		        <!-- <form action=""> -->
		          <div class="form-group">
		            <label for="username">username</label><span class="alert">${errors.userName }</span>
		            <input type="text" required class="form-control" name="userName" id="username" placeholder="username">
		          </div>
		          <div class="form-group">
		            <label for="password">Password</label><span class="alert">${errors.password }</span>
		            <input type="password" required class="form-control" name="password" id="password" placeholder="Password">
		          </div>
		          <div class="form-group">
		            <label for="email"">Email address</label>
		            <input type="email" name="email" class="form-control" id="email" placeholder="Email">
		          </div>
		          <div class="form-group">
		            <label for="sex"">Sex</label>
		            <input type="text" name="sex" class="form-control" id="sex" placeholder="Sex">
		          </div>
		          <div class="form-group">
		            <label for="birthday"">Birthday</label>
		            <input type="text" name="birthday" class="form-control" id="birthday" placeholder="YYYY-MM-dd">
		          </div>
		          <div class="form-group">
		            <label for=""phone""">Phone</label>
		            <input type="text" name="phone" class="form-control" id="phone" placeholder="Phone">
		          </div>
		          <div class="form-group">
		            <label for=""age""">Age</label>
		            <input type="text"  class="form-control" name="age" id="age" placeholder="Age">
		          </div>
		          <button type="submit" class="btn btn-primary" >Submit</button>
		          <span class="alert">${exceptionInfo }</span>
		        </form>
		      </div>
		    </div>
        </c:otherwise>
    </c:choose>

<script type="text/javascript">

</script>
</body>
</html>